//
//  QDMetroCodeManager.h
//  QDMetroClient
//
//  Created by YueWen on 2019/2/26.
//  Copyright © 2019 YueWen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "QDMetroHeaderErrorType.h"

NS_ASSUME_NONNULL_BEGIN

@protocol QDCodeManager;

/// 青岛地铁数据协议
@protocol QDCodeDataManager <NSObject>

/// codeManger生成二维码成功的回调,可直接生成二位码的字符串
- (void)codeManager:(id<QDCodeManager>)codeManager codeString:(NSString *)code info:(nullable NSDictionary *)info image:(nullable UIImage *)codeImage;

/// codeManager生成所需二维码失败的回调，error
- (void)codeManager:(id<QDCodeManager>)codeManager failType:(QDMetroHeaderErrorType)type;

@end

/// 青岛地铁App 二维码管理的协议方法
@protocol QDCodeManager <NSObject>

/// 代理
@property (nonatomic, weak, nullable) id <QDCodeDataManager> codeDelegate;
/// popView的title
@property (nonatomic, copy, readonly) NSArray <NSString *> *titles;
/// 付款类型
@property (nonatomic, copy) NSString *channelType;
/// 是否存在付款方式
@property (nonatomic, assign) BOOL hasChannel;
/// popView对应的image
@property (nonatomic, copy, readonly) NSArray <NSString *> *imageNames;
/// 二维码下面的描述
@property (nonatomic, copy, nullable, readonly) NSString *title;

/// 成为真实的响应者，用于立马进行检测或者网络请求
- (void)becomeFirstControl;
/// 放弃成为真实的响应者
- (void)resignFirstControl;
/// 停止请求
- (void)cancleRequest;
/// 强制刷新
- (void)reloadForce;

@end




NS_ASSUME_NONNULL_END
